<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改更新操作')" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-forceReplace-edit" th:object="${forceReplace}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">项目类型：</label>
                <div class="col-sm-8" th:if="${forceReplace.projectType== '0'}" >
                    <label class="radio-box"><input type="radio" value="0" checked="" name="projectType">服务商</label>
                    <label class="radio-box"><input type="radio" value="3" name="projectType">商户</label>
                </div>
                <div class="col-sm-8" th:if="${forceReplace.projectType== '3'}" >
                    <label class="radio-box"><input type="radio" value="0"  name="projectType">服务商</label>
                    <label class="radio-box"><input type="radio"value="3" checked="" name="projectType">商户</label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">市场类型：</label>
                <div class="col-sm-8">
                    <input name="channel" th:field="*{channel}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8" th:if="${forceReplace.sysmark=='1'}">
                    <label class="radio-box"><input type="radio" checked="" value="1" name="sysmark">android</label>
                    <label class="radio-box"><input type="radio"  value="2" name="sysmark">ios</label>
                </div>
                <div class="col-sm-8" th:if="${forceReplace.sysmark=='2'}">
                    <label class="radio-box"><input type="radio" value="1" name="sysmark">android</label>
                    <label class="radio-box"><input type="radio" value="2" checked="" name="sysmark">ios</label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">下载地址：</label>
                <div class="col-sm-8">
                    <input name="address" th:field="*{address}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否强制：</label>
                <div class="col-sm-8" th:if="${forceReplace.force=='1'}" >
                    <label class="radio-box"><input type="radio" value="1" checked="" name="force">是</label>
                    <label class="radio-box"><input type="radio" value="2" name="force">否</label>
                </div>
                <div class="col-sm-8" th:if="${forceReplace.force=='2'}" >
                    <label class="radio-box"><input type="radio" value="1"  name="force">是</label>
                    <label class="radio-box"><input type="radio" value="2" checked="" name="force">否</label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">版本号：</label>
                <div class="col-sm-8">
                    <input name="version" th:field="*{version}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">更新内容：</label>
                <div class="col-sm-8">
                    <textarea rows="10" cols="10" name="content" th:field="*{content}" class="form-control" type="text"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script th:inline="javascript">
        var prefix = ctx + "forceReplace/forceReplace";
        $("#form-forceReplace-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-forceReplace-edit').serialize());
            }
        }

        $(document).ready(function () {
            $('.summernote').summernote({
                lang: 'zh-CN'
            });
        });
        var edit = function () {
            $("#eg").addClass("no-padding");
            $('.click2edit').summernote({
                lang: 'zh-CN',
                focus: true
            });
        };
        var save = function () {
            $("#eg").removeClass("no-padding");
            var aHTML = $('.click2edit').summernote('code');
            $('.click2edit').summernote('destroy');
        };
    </script>
</body>
</html>